﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using AuthenticationSection;

namespace AuthenticationDemo
{
    public partial class Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(UserInfo.Identity) && UserInfo.GetInstance.IsRole("1,2"))//用户通过验证并且有权限
            {
                Label1.Text = "用户名：" + UserInfo.Identity;
            }
            else
            {
                Label1.Text = "false";
            }
        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            //todo
            //Factory factory
        }
    }
}